//Koa对象创建服务应用
const Koa = require('koa')
const cors = require("koa2-cors")
const app = new Koa()
const bodyParser = require('koa-bodyparser');
const goodsRouter = require('./router/goods')

app.use(cors())
app.use(bodyParser())
app.use(goodsRouter.routes(), goodsRouter.allowedMethods())

const port = 3001
app.listen(port)
console.log(`启动成功,服务端口为:${port}`)